import request from "@/utils/request";
//参数分类列表
export const getparams = () => {
  return request({
    method: "GET",
    url: "/categories",
  });
};
//参数列表
// categories/:id/attributes
export const lieparams = (id, data) => {
  return request({
    method: "GET",
    url: `/categories/${id}/attributes`,
    params: data,
  });
};

//添加动态或者静态参数
// categories/:id/attributes
export const tianparams = (id, data) => {
  return request({
    method: "POST",
    url: `/categories/${id}/attributes`,
    data,
  });
};

// categories/:id/attributes/:attrId
// 根据Id查询参数
export const bianparams = (id, attrId, data) => {
  return request({
    method: "GET",
    url: `/categories/${id}/attributes/${attrId}`,
    data,
  });
};

//编辑提交参数
// categories/:id/attributes/:attrId
export const tiparams = (id, attrId, data) => {
  return request({
    method: "PUT",
    url: `/categories/${id}/attributes/${attrId}`,
    data,
  });
};

//删除参数
// categories/:id/attributes/:attrid
export const shanparams = (id, attrId) => {
  return request({
    method: "DELETE",
    url: `/categories/${id}/attributes/${attrId}`,
  });
};
